﻿using System;
using System.Collections.Generic;
using System.Linq;
using NotifiableLinqTests.MetaGenerator;
using NUnit.Framework;

namespace TestProject1
{
	[TestFixture]
	public class Class1
	{
		[Test]
		public void Test()
		{
			var sut = new Generator();

			Assert.IsFalse(sut.ComareType(typeof(Func<int, bool>), typeof(Func<int, int, bool>)));
			Assert.IsFalse(sut.ComareType(typeof(Func<int, bool>), typeof(Func<uint, bool>)));
			Assert.IsTrue(sut.ComareType(typeof(Func<Func<int, uint>, Func<int, Func<int>>, bool>), typeof(Func<Func<int, uint>, Func<int, Func<int>>, bool>)));
			Assert.IsFalse(sut.ComareType(typeof(Func<Func<int, uint>, Func<int, Func<int>>, bool>), typeof(Func<Func<int, uint>, Func<int, Func<uint>>, bool>)));

			var sle = typeof(Enumerable).GetMethods().Where(x => x.Name == "Where").First();
			var sle2 = typeof(Enumerable).GetMethods().Where(x => x.Name == "Where").Skip(1).First();

			var oe = typeof(LiveLinq.ObservableEnumerable).GetMethods().Where(x => x.Name == "Where").First();

			Assert.IsTrue(sut.ComareMethodParameters(sle.GetParameters(), oe.GetParameters()));
			Assert.IsFalse(sut.ComareMethodParameters(sle2.GetParameters(), oe.GetParameters()));
		}

		[Test]
		public void Test2()
		{
			new Generator().ToString();
		}
	}
}
